package com.mybed.crm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybed.crm.mapper.BusinessMapper;
import com.mybed.crm.mapper.CluesMapper;
import com.mybed.crm.mapper.UserMapper;
import com.mybed.crm.pojo.dto.PageTransferDto;
import com.mybed.crm.pojo.pojo.User;
import com.mybed.crm.pojo.vo.TransferVo;
import com.mybed.crm.result.PageResult;
import com.mybed.crm.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class TransferServiceImpl implements TransferService {
    @Autowired
    private CluesMapper cluesMapper;
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private BusinessMapper businessMapper;
    @Override
    public PageResult page(PageTransferDto dto, String beginTime, String endTime) {
        IPage<TransferVo> page=new Page<>(dto.getPageNum(),dto.getPageSize());
        IPage<TransferVo> iPage=userMapper.PageTransfer(page,null,dto,beginTime,endTime);
        PageResult result=new PageResult();
        result.insertData(iPage);
        return result;
    }
}
